# print("1")
# print("2")
# print("3")

# # input的返回值是字符串类型，因此使用字符串进行比较
# choice = input("输入 1 表示认真学习, 输入 2 表示躺平摆烂: ")
# if choice == "1":
#     print("你会找到好工作!") # 使用缩进代表执行条件语句
# elif choice == "2":
#     print("你可能毕业就失业了!")
# else:
#     print("你的输入有误!")

# a = input("请输入一个整数: ")
# if a == "1":
#     print("hello")
#     print("world")

# a = input("请输入一个整数: ")
# if a == "1":
#     print("hello")
# print("world")

# a = input("请输入第一个整数: ")
# b = input("请输入第二个整数: ")
# if a == "1":
#     if b == "2":
#         print("hello")
#     print("world")
# print("python")

# # 输入一个整数, 判定是否是奇数
# # input返回值是字符串类型，需要转换成整型
# num = int(input("请输入一个整数："))
# if(num % 2 == 0):
#     print(f"num = {num}是偶数")
# else:
#     print(f"num = {num}不是偶数")

# # 输入一个整数, 判定是正数还是负数
# num = int(input("请输入一个整数："))
# if num > 0:
#     print(f"num = {num} 是正数")
# elif num < 0:
#     print(f"num = {num} 是负数")
# else:
#     print(f"num = {num} 等于0")

# # 判定年份是否是闰年
# year = int(input('请输入年份：'))
# if year % 100 == 0:
#     # 判断世纪闰年
#     if year % 400 == 0:
#         print(f'year = {year} 是闰年')
#     else:
#         print(f'year = {year} 是平年')
# else:
#     # 判断普通闰年
#     if year % 4 == 0:
#         print(f'year = {year} 是闰年')
#     else:
#         print(f'year = {year} 是平年')

# year = int(input('请输入年份：'))
# if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0):
#     print(f'year = {year} 是闰年')
# else:
#     print(f'year = {year} 是平年')

# a = int(input("请输入一个整数:"))
# if a == 1:
#     print("hello")

# a = int(input("请输入一个整数:"))
# if a != 1:
#     pass
# else:
#     print("hello")

# a = int(input("请输入一个整数:"))
# if a != 1:
#
# else:
#     print("hello")

# # 打印 1-10 的整数
# num = 1
# while num <= 10:
#     print(num)
#     num += 1

# # 计算 1-100 的和
# num = 1 # 枚举1-100的数
# sum = 0 # 计算总和
# while num <= 100:
#     sum += num
#     num += 1
# print(f'总和 sum = {sum}')

# # 计算 5 的阶乘 5 * 4 * 3 * 2 * 1
# num = 5
# fac = 1 # factorial 阶乘英文单词
# while num >= 1:
#     fac *= num
#     num -= 1
# print(f'num的阶乘为{fac}')

# # 求 1! + 2! + 3! + 4! + 5!
# num = 1
# sum = 0
# while num <= 5:
#     fac =1
#     i = 1
#     while i <= num:
#         # 计算1-5之间的阶乘
#         fac *= i
#         i +=1
#     # 累加阶乘并将num+1
#     sum += fac
#     num += 1
# print(f'sum = {sum}')

# 求 1! + 2! + 3! + 4! + 5!
# 2! = 1! * 2   num! = (num-1)!*num

# num = 1
# fac = 1
# sum = 0
# while num <= 5:
#     fac *= num
#     sum += fac
#     num += 1
# print(f'sum = {sum}')

# # 打印 1-10
# for num in range(1,11):
#     print(num)

# # 打印 2, 4, 6, 8, 10
# for num in range(2,12,2):
#     print(num)

# # 打印 10-1
# for num in range(10,0,-1):
#     print(num)

# # 求 1 - 100 的和
# sum = 0
# for num in range(1,101):
#     sum += num
# print(f'sum = {sum}')

# for i in range(1,6):
#     if i ==3: # i 等于3进入下一次循环
#         continue
#     print(f'吃完第{i}个包子')

# for i in range(1,6):
#     if i == 3: # i 等于3跳出循环
#         break
#     print(f'吃完了第{i}个包子')

# 输入若干个数字, 求平均值. 使用 "分号" 作为结尾.
sum = 0 # 计算数字总和
count = 0 # 记录数字个数
while True:
    num = input("请输入数字：")
    if num == ";":
        break
    num = float(num)
    sum += num
    count += 1
print(f'平均值 = {sum / count}')